<IfModule mod_rewrite.c>
    RewriteEngine On

    # Limitar el acceso a 10 solicitudes cada 10 segundos
    RewriteCond %{REQUEST_METHOD} GET
    RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$  # Permitir localhost
    RewriteCond %{HTTP_USER_AGENT} !Googlebot  # Permitir Googlebot (ajusta según necesites)
    RewriteRule ^ - [F,L,NS=10]

    # Para prevenir ataques de flood, utiliza mod_ratelimit
    <IfModule mod_ratelimit.c>
        SetEnv rate-limit 10  # Limita a 10 KB/s
    </IfModule>
</IfModule>

# Proteger el acceso a wp-admin (ajusta la ruta según tu necesidad)
<FilesMatch ".*">
    Order Deny,Allow
    Deny from all
    Allow from 192.168.1.0/24  # Cambia por tu rango de IP permitido
</FilesMatch>

# Evitar el acceso a archivos sensibles
<FilesMatch ".*\.ini$">
    Order Deny,Allow
    Deny from all
</FilesMatch>